import store from 'lib/vuex/store.js'
import { hasToken } from 'lib/vuex/getters';

export default {
  bind() {
		this.el.style.display= "none";
  },
  update(value) {
		//let token = $(this.el).data("token");
		//let token = value.token;
		let el = this.el;
		let token = value;
		$(el).ready(()=> {
			if(!hasToken(store.state,token)) {
				el.style.display = "none";	
				if($(el).data("mode")=="toggle-box") {
					$(el).siblings().css({
						"float": "none",
						"margin": "0 auto",
					});
				}
			} else {
				el.style.display = "block";
			}
		})
  }
}